<?

$dataup = true;
$uprun  = true;

if($uprun == true && $dataup > 0){
	
	/**
	* We are good with details
	* continue with the header check 
	*
	*/
	if($_POST["usrIdEnt"]    != '' &&
	   $_POST["usrNmEnt"]    != '' &&
	   $_POST["usrPwdEnt"]   != '' ){
		
		//everything is good
		//open confirmation form
		if(!$_POST["confirm"] && !$_POST["back"]){
			
			require("entry_upload_confirm.php");
		}elseif($_POST["back"]){
			
			require("entry_restore_me.php");
		}else{
			
			/**
			* Prepare to upload
			* modify mode is on 
			*
			*/
			if($_SESSION["modify_mode"] == "Y" && $_SESSION["jid"] != ''){
				
				/**
				* Reset the modify_mode
				*
				*/
				$_SESSION["modify_mode"] = "N";
				
				require("upmodifytodb.php");
			}elseif($_SESSION["modify_mode"] != "Y"){ //if modify mode is off
				
				require("upentrytodb.php");
			}else{
				
				$Misc->usrError("Error: Unknown Upload Task");
			}
		}
	}else{
		
		$Misc->usrError("Error:  No empty field allowed please make a correction reason: header incompleted");
		
		require("entry_restore_me.php");
	}
}

if($uprun == false){
	
	echo "Restoring...\n";
	$restore  = 0;
	$uprun    = 0;
	$dataup   = 0;
	
	require("entry_restore_me.php");
}
?> 